package com.danci.mapper;

import com.danci.dto.LearnRecord;
import com.danci.entity.Words;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 单词表 Mapper 接口
 * </p>
 *
 * @author xxx
 * @since 2024-05-13
 */
public interface WordsMapper extends BaseMapper<Words> {

    void deleteRecord(@Param("userId") String userId,@Param("wordId")String wordId);
    void addLearnRecord(@Param("record") LearnRecord learnRecord);

    Integer getPlanDay(@Param("userId") String userId);

    List<Words> findNewWords(@Param("lid") String lid,
                             @Param("wordIds") List<String> wordIds,
                             @Param("limit") Integer limit);

    List<LearnRecord> findLearnRecordsByDateAndType(@Param("date")Date date,
                                                    @Param("learnType")Integer learnType,
                                                    @Param("userId")String userId);

    Integer getRecordLearnCount(@Param("userId")String userId);
}
